package com.shane.music.scrubber
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class muteBtn extends MovieClip
	{
		private var isMuted:Boolean = false;
		private var mom:MovieClip;
		public function muteBtn() 
		{
			this.addEventListener(MouseEvent.CLICK, muteToggle, false, 0, true);
			this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
			mom = this.parent as MovieClip;
			stop();
		}
		private function mouseDown (e:MouseEvent):void {
				this.gotoAndStop(4);
		}
		public function unMuted ():void {
			isMuted = false;
			this.gotoAndStop(1);
		}
		private function muteToggle (e:Event) :void {
			if(isMuted) {
				isMuted = false;
				mom.thumb.unMute();
				this.gotoAndStop(1);
			} else {
				isMuted = true;
				mom.thumb.mute();
				this.gotoAndStop(3);
			}
		}
	}
}